package com.eBook.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.eBook.entity.Book;
import com.eBook.service.BookService;

@Controller
@RequestMapping(value = "/book")
public class BookController {
	@Autowired
	private BookService bookService;
	
	@RequestMapping(value = "/{typeId}")
	@ResponseBody
	public List<Book> findAllBooksByTypeId(@PathVariable("typeId")int typeId){
		
		return bookService.findAllBooksByTypeId(typeId);
	}
	
	
}

